#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# This file is public domain software, originally written by Joey Hess. 
#
# This version is for packages that are architecture dependent.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

unexport AXIS2C_HOME STAFF_HOME

DEBIAN_DIR = $(dir $(realpath $(lastword $(MAKEFILE_LIST))))

build: build-stamp
build-stamp:
	dh_testdir
	$(MAKE) -j6 USER=fakeroot -C$(realpath $(DEBIAN_DIR)../../..)
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	test -n "$(DO_NOT_CLEAN_SOURCES)" || DO_NOT_CLEAN_SOURCES=1 $(MAKE) distclean -j6 -C$(realpath $(DEBIAN_DIR)../../..)
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	$(MAKE) -j4 USER=fakeroot prefix=`pwd`/debian distrib_deploy -C$(realpath $(DEBIAN_DIR)../..)

# Build architecture-independent files here.
binary-indep: build install

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_installexamples
	dh_installman
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
